<template>
    <div class='admin'>
        <my-header></my-header>

        <div class='admin-main'>
            <div class='admin-main-right'>
                <el-menu theme="dark" class="top-menu">
					  <el-submenu index="1">
                        <template slot="title">用户管理</template>
						<el-menu-item index="1-1" @click="controlJump('/admin/user-list')">用户列表</el-menu-item>
					</el-submenu>
					<el-submenu index="2">
						<template slot="title">会员管理</template>
						<el-menu-item index="2-1" @click="controlJump('/admin/member-list')">会员列表</el-menu-item>
					</el-submenu>
					<el-submenu index="3">
						<template slot="title">类型管理</template>
						<el-menu-item index="3-1" @click="controlJump('/admin/goodstype-list')">类型列表</el-menu-item>
					</el-submenu>
					<el-submenu index="4">
						<template slot="title">商品管理</template>
						<el-menu-item index="4-1" @click="controlJump('/admin/goods-list')">商品列表</el-menu-item>
					</el-submenu>
					<el-submenu index="5">
						<template slot="title">订单管理</template>
						<el-menu-item index="5-1" @click="controlJump('/admin/order-list')">订单列表</el-menu-item>
					</el-submenu>
				</el-menu>
			</div>
			<div class='admin-main-left'>
				<router-view></router-view>
			</div>
		</div>
	</div>
</template>

<script>
	import Header from './common/header.vue';

	export default {
		name: 'admin',

		components: {
			'my-header': Header,
		},

		computed: {
			user() {
				return this.$store.state.user;
			},
		},

		methods: {
			// 跳转控制
			controlJump(target) {
					//todo 做权限判断
					this.$router.push(target);

			}
		},

	}

</script>
